package com.lijianlove.message.confirm.task;

import com.lijianlove.message.confirm.service.ConfirmService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;

/**
 * @author lijian
 * @date 2019/5/30 下午4:49
 */
@Slf4j
@Component
public class ConfirmTask {
    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");

    @Autowired
    private ConfirmService confirmService;

    //每隔2秒执行一次
    @Scheduled(fixedRate = 2000)
    public void verifyTask() {
        confirmService.verify();
    }

}
